package com.sqoop.core.futruecache;

import com.sqoop.core.MsgFutrue.MsgFutrue;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by zw on 2017/11/13.
 */
public class MsgFutureCache implements FutureCache<MsgFutrue>{
    private static Map<String,MsgFutrue> futrueMap = new ConcurrentHashMap<>();

    public MsgFutureCache(){

    }

    @Override
    public void save(String id, MsgFutrue future) {
        futrueMap.put(id,future);
    }

    @Override
    public MsgFutrue get(String id) {
       return futrueMap.get(id);
    }

    //内部清除队列 但是需要需要在这边实现 还是在MsgFutrue 直接加上默认值
    public class ClearThread implements Runnable{
        @Override
        public void run() {
            //for (futrueMap.)
        }
    }

}